<?php

use Illuminate\Support\Facades\Route;

//首页路由
Route::get('/', [\App\Http\Controllers\IndexController::class, 'index'])->name('home');
//用户资源路由
Route::resource('user', '\App\Http\Controllers\UserController');
//登录路由
Route::get('logout', [\App\Http\Controllers\LoginController::class, 'logout'])->name('logout');
Route::get('login', [\App\Http\Controllers\LoginController::class, 'login'])->name('login');
Route::post('login', [\App\Http\Controllers\LoginController::class, 'store'])->name('login');

//邮箱注册
Route::get('confirmmailtoken/{token}', [\App\Http\Controllers\UserController::class, 'confirmmailtoken'])->name('confirmmailtoken');

//找回密码功能
Route::get('FindPasswordEmail', [\App\Http\Controllers\PasswordController::class, 'email'])->name('FindPasswordEmail');
Route::post('FindPasswordSend', [\App\Http\Controllers\PasswordController::class, 'send'])->name('FindPasswordSend');
Route::get('FindPasswordEdit/{token}', [\App\Http\Controllers\PasswordController::class, 'edit'])->name('FindPasswordEdit');
Route::post('FindPasswordUpdate', [\App\Http\Controllers\PasswordController::class, 'update'])->name('FindPasswordUpdate');


//博客
Route::resource('blog', \App\Http\Controllers\BlogController::class);

//关注取消关注
Route::get('follow/{user}', [\App\Http\Controllers\UserController::class, 'follow'])->name('user.follow');

//粉丝路由
Route::get('followed/{user}', [\App\Http\Controllers\FollowController::class, 'follow'])->name('follow.follow');
Route::get('following/{user}', [\App\Http\Controllers\FollowController::class, 'following'])->name('follow.following');
